package com.learn.sunday.auth.controller;

import com.learn.sunday.auth.bean.KeepAlive;
import com.learn.sunday.auth.bean.RegisterObject;
import com.learn.sunday.auth.bean.ResponseStatus;
import com.learn.sunday.auth.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping(value = "VIID/System")
public class SystemController {


    @Autowired
    private SystemService systemService;

    @PostMapping(value = "Register")
    public void doRegister(@RequestBody RegisterObject registerObject, HttpServletRequest request, HttpServletResponse response) {
        systemService.doRegister(registerObject,request,response);
    }

    @PostMapping(value = "Keepalive")
    public ResponseStatus doKeepalive(@RequestBody KeepAlive keepAlive, HttpServletRequest request, HttpServletResponse response) {
        return systemService.doKeepalive(keepAlive,request,response);
    }
}
